﻿<%@ Page Title="" Language="C#" MasterPageFile="~/WebSite.Master" AutoEventWireup="true"
    CodeBehind="UserMain.aspx.cs" Inherits="RN.ERP.Web.UserMain" %>

<%@ Register Src="~/UserControl/UCMarketInfo.ascx" TagName="ucMarketInfo" TagPrefix="ucMarketInfo" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
        .style1
        {
            height: 33px;
            line-height: 33px;
            font-size: 14px;
            font-weight: bold;
            color: #fff;
            background: url('../images/xx_m.jpg') repeat-x;
            width: 19px;
        }
        .style2
        {
            background: url('../images/l_conlibg.jpg') repeat-y;
            width: 19px;
        }
        .style3
        {
            background: url('../images/con_m.jpg') repeat-x;
            width: 19px;
        }
    </style>
    <script type="text/javascript" src="../Scripts/UserMain.js"></script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td style="height: 5px;">
            </td>
        </tr>
        <tr>
            <td width="100%" valign="top">
                <div class="user_li">
                    <div class="useLi">
                    </div>
                    <div class="useL">
                        <h3>
                            用户名:<asp:Literal runat="server" ID="ltrLoginUser"></asp:Literal></h3>
                        <span><strong>企业名称：</strong><asp:Literal runat="server" ID="ltrLoginCorpName"></asp:Literal></span>&nbsp;&nbsp;&nbsp;&nbsp;
                        <span><strong>企业类型：</strong><asp:Literal runat="server" ID="ltrLoginCorpType"></asp:Literal></span>
                        &nbsp;&nbsp;&nbsp;&nbsp; <span><strong>企业工商注册地：</strong><asp:Literal runat="server"
                            ID="ltrLoginCorpRegisterArea"></asp:Literal></span>
                    </div>
                    <div class="useR">
                    </div>
                </div>
                <div class="clear">
                </div>
                <div class="right">
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;
                        border-collapse: collapse; padding: 0">
                        <tr>
                            <td class="xx_m  tt_xx_l">
                            </td>
                            <td class="xx_m  tt_xx_icon">
                            </td>
                            <td style="width: auto;" class="xx_m">
                                企业基本信息
                            </td>
                            <td style="width: 14px;">
                                <img src="../images/xx_r.jpg" width="14" height="33" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                            </td>
                            <td colspan="2" style="padding-top: 10px; padding-left: 6px;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="58%" class="xx" nowrap="nowrap">
                                            <strong>企业名称：</strong>
                                            <asp:Literal ID="ltrCorpName" runat="server"></asp:Literal>
                                            <br />
                                            <strong>企业地址：</strong>
                                            <asp:Literal ID="ltrCorpAddress" runat="server"></asp:Literal><br />
                                            <strong>注册资金（万元）：</strong>
                                            <asp:Literal ID="ltrCorpRegisterMoney" runat="server"></asp:Literal>
                                        </td>
                                        <td width="16%">
                                            <div style="display:<%=SystemID=="101"?"none":"block"%>">
                                            <a class="tt_gdxx" href="javascript:AddCorpTab();">浏览更多企业</a>
                                            </div>
                                        </td>
                                        <td width="26%" rowspan="5" valign="top">
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="icon_bg">
                                                <%-- <tr>
    <td>
      <div class="market" title="点击查看、切换市场范围"><asp:Literal runat="server" ID="ltrCurrentMarket"></asp:Literal></div>
    </td>
      
  </tr>
  <tr>
    <td>
      <div class="shenhe"><asp:Literal runat="server" ID="ltrCurrentMarketFlow"></asp:Literal></div>
    </td>
  </tr>--%>
                                                <tr>
                                                    <td>
                                                        <ucMarketInfo:ucMarketInfo ID="ucMarketInfo" runat="server" />
                                                        <div class="shenhe" runat="server" id="divCurrentFlowCode">
                                                            <asp:Literal runat="server" ID="ltrCurrentMarketFlow"></asp:Literal>
                                                        </div>
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        <%--<div class="ckicon"><a href="#">查看</a></div>--%>
                                                        <%--<asp:Button runat="server" Text="上报" ID="btnCurrentMarketOperation" 
            CssClass="ckicon" onclick="btnCurrentMarketOperation_Click" />--%>
                                                        <input type="button" runat="server" id="btnPost" class="ckicon" value="上报" />
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td height="20" colspan="2" class="xx_bg">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <div class="title">
                                                企业资质</div>
                                            <telerik:RadGrid ID="RadGridCorpQuals" runat="server" AutoGenerateColumns="False"
                                                AllowPaging="True" PageSize="5" Culture="zh-CN">
                                                <ClientSettings>
                                                </ClientSettings>
                                                <MasterTableView>
                                                    <Columns>
                                                        <telerik:GridTemplateColumn HeaderText="序号">
                                                            <ItemTemplate>
                                                                <%#Container.ItemIndex+1 %>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn HeaderText="资质名称" DataField="DetailName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="资质等级" DataField="GradeName">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridTemplateColumn HeaderText="是否主项">
                                                            <ItemTemplate>
                                                                <%#bool.Parse(Eval("isMain") == null ? "false" : Eval("isMain").ToString()) ? "是" : "否"%>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn HeaderText="发证日期" DataField="GetDate" DataFormatString="{0:d}">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn HeaderText="有效期至" DataField="zzzEndDate" DataFormatString="{0:d}">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                </MasterTableView>
                                                <HeaderStyle Font-Bold="true" Font-Size="12px" HorizontalAlign="Center" />
                                                <ItemStyle HorizontalAlign="Center" />
                                                <AlternatingItemStyle HorizontalAlign="Center" />
                                                <PagerStyle Mode="NumericPages" />
                                            </telerik:RadGrid>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2" height="20">
                                        </td>
                                    </tr>
                                    <tr>
                                        <td colspan="2">
                                            <div class="title">
                                                企业工作人员</div>
                                            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="tab">
                                                <tr>
                                                    <td bgcolor="#f2f2f2" nowrap="nowrap">
                                                        <strong>序号</strong>
                                                    </td>
                                                    <td bgcolor="#f2f2f2" nowrap="nowrap">
                                                        <strong>执业注册师资格</strong>
                                                    </td>
                                                    <td bgcolor="#f2f2f2" nowrap="nowrap">
                                                        <strong><asp:Literal id="litTitle" runat="server" />
                                                         </strong>
                                                    </td>
                                                </tr>
                                                <asp:Repeater ID="RepEmpCount" runat="server" EnableViewState="false">
                                                    <ItemTemplate>
                                                        <tr>
                                                            <td>
                                                                <%#Container.ItemIndex+1 %>
                                                            </td>
                                                            <td>
                                                                <%#Eval("Key") %>
                                                            </td>
                                                            <td>
                                                                <%#Eval("Value") %>
                                                            </td>
                                                        </tr>
                                                    </ItemTemplate>
                                                </asp:Repeater>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td class="right_con">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                <img src="../images/left_bottom.jpg" width="19" height="24" alt="" />
                            </td>
                            <td colspan="2" class="con_m">
                                &nbsp;
                            </td>
                            <td>
                                <img src="../images/right_bottom.jpg" width="14" height="24" alt="" />
                            </td>
                        </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" style="table-layout: fixed;
                        border-collapse: collapse; padding: 0;">
                        <tr>
                            <td class="xx_m  tt_xx_l">
                            </td>
                            <td class="xx_m  tt_xx_icon">
                            </td>
                            <td style="width: auto;" class="xx_m">
                                企业业务
                            </td>
                            <td style="width: 14px;">
                                <img src="../images/xx_r.jpg" width="14" height="33" />
                            </td>
                        </tr>
                        <tr>
                            <td class="style2">
                            </td>
                            <td colspan="2">
                                <div id="con">
                                    <ul id="tags">
                                        <li class="selectTag"><a onclick="selectTag('tagContent0',this)" href="javascript:void(0)">
                                            企业业绩</a> </li>
                                        <li><a onclick="selectTag('tagContent1',this)" href="javascript:void(0)">人员业绩</a>
                                        </li>
                                        <li><a onclick="selectTag('tagContent2',this)" href="javascript:void(0)">企业信用</a>
                                        </li>
                                    </ul>
                                    <div id="tagContent">
                                        <div class="tagContent selectTag" id="tagContent0">
                                            第一个标签的内容</div>
                                        <div class="tagContent" id="tagContent1">
                                            第二个标签的内容</div>
                                        <div class="tagContent" id="tagContent2">
                                            第三个标签的内容</div>
                                    </div>
                                </div>
                                <script type="text/javascript">
                                    function selectTag(showContent, selfObj) {
                                        // 操作标签
                                        var tag = document.getElementById("tags").getElementsByTagName("li");
                                        var taglength = tag.length;
                                        for (i = 0; i < taglength; i++) {
                                            tag[i].className = "";
                                        }
                                        selfObj.parentNode.className = "selectTag";
                                        // 操作内容
                                        for (i = 0; j = document.getElementById("tagContent" + i); i++) {
                                            j.style.display = "none";
                                        }
                                        document.getElementById(showContent).style.display = "block";
                                    }
                                </script>
                            </td>
                            <td class="right_con">
                                &nbsp;
                            </td>
                        </tr>
                        <tr>
                            <td class="style3">
                                <img src="../images/left_bottom.jpg" width="19" height="24" alt="" />
                            </td>
                            <td colspan="2" class="con_m">
                                &nbsp;
                            </td>
                            <td>
                                <img src="../images/right_bottom.jpg" width="14" height="24" alt="" />
                            </td>
                        </tr>
                    </table>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                            <td width="51%" style="vertical-align: top;">
                                <table width="99%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 19px" class="xx_m">
                                            <img src="../images/xx_l.jpg" width="19" height="33" />
                                        </td>
                                        <td style="width: 31px" class="xx_m">
                                            <img src="../images/xx.jpg" width="24" height="33" />
                                        </td>
                                        <td style="width: auto" class="xx_m">
                                            信息互递
                                        </td>
                                        <td style="width: 19px">
                                            <img src="../images/xx_r.jpg" width="14" height="33" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="left_con">
                                        </td>
                                        <td colspan="2">
                                            <div id="chatBriefDiv">
                                            </div>
                                        </td>
                                        <td class="right_con">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="con_m tt_left_bottom">
                                            &nbsp;
                                        </td>
                                        <td colspan="2" class="con_m">
                                            &nbsp;
                                        </td>
                                        <td class="tt_right_bottom">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                            <td width="49%" style="vertical-align: top;">
                                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td width="19px" class="xx_m">
                                            <img src="../images/xx_l.jpg" width="19" height="33" />
                                        </td>
                                        <td width="31px" class="xx_m">
                                            <img src="../images/xtxx.jpg" width="24" height="33" />
                                        </td>
                                        <td width="auto" class="xx_m">
                                            系统消息
                                        </td>
                                        <td width="19px">
                                            <img src="../images/xx_r.jpg" width="14" height="33" />
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="left_con">
                                        </td>
                                        <td colspan="2">
                                            <div id="letterBriefDiv">
                                            </div>
                                        </td>
                                        <td class="right_con">
                                            &nbsp;
                                        </td>
                                    </tr>
                                    <tr>
                                        <td class="con_m tt_left_bottom">
                                            &nbsp;
                                        </td>
                                        <td colspan="2" class="con_m">
                                            &nbsp;
                                        </td>
                                        <td class="tt_right_bottom">
                                            &nbsp;
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                    <script>
                        (function () {
                            var chatBrief = $("#chatBriefDiv")
                            , letterBrief = $("#letterBriefDiv")
                            , Users = top.Users
                            , userStore = {}
                            , roleStore = {
                                "88": "主管1"
                                , "101": "主管2"
                                , "110": "主管3"
                                , "42": "监理企业"
                                , "15": "施工企业"
                                , "other": "其他"
                            };
                            if (!Users) {
                                $.get("../Message/MsgPushHandler.ashx", { Func: "GetUsers" }, function (data) {

                                    if (!data) {
                                        $.ligerDialog.error("用户列表获取失败！");
                                    }
                                    Users = data;
                                    InitUser();
                                }, "json");
                            }
                            if (!Users) return;

                            InitUser();
                            BindLetterBrief();

                            function InitUser() {
                                for (var i = 0; i < Users.length; i++) {
                                    userStore[Users[i].UserGuid] = Users[i];
                                }
                            }

                            function BindLetterBrief() {
                                $.get("../Message/MsgPushHandler.ashx", { Func: "GetLetterBrief" }, function (data) {
                                    if (!data) {
                                        letterBrief.html("站内信获取失败.");
                                    } else {
                                        ShowLetterBrief(data);
                                    }
                                }, "json");
                            }

                            function ShowLetterBrief(data) {
                                var html = "<table style='width:100%;'>";

                                for (var i = 0, len = data.length; i < len; i++) {
                                    html += "<tr>";
                                    html += "<td>" + (roleStore[data[i].Receiver] || (userStore[data[i].Receiver] ? userStore[data[i].Receiver].Name : null) || roleStore["other"]) + "</td>";
                                    html += "<td>&nbsp;" + data[i].SendTime + "</td>"
                                    html += "<td>&nbsp;" + nodeTextToShort(data[i].MsgText) + "</td>"
                                    html += "</tr>";
                                }
                                html += "</table>";
                                letterBrief.html(html);
                                $("<a href='###'>更多</a>").css({ color: "blue" }).click(function () {
                                    top.addTabExtend(top.$("#siteLetterLi"), 'Message/MessageList.aspx', '站内信');
                                    top.$("#chatCountor").empty();
                                }).appendTo(letterBrief);
                            }

                            function nodeTextToShort(text, len) {
                                var MAX_NODETEXT_LENGTH = len || 20;
                                if (text.length > MAX_NODETEXT_LENGTH) {
                                    return text.substring(0, MAX_NODETEXT_LENGTH - 1) + "...";
                                }
                                return text;
                            }

                        })()
                    </script>
                    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Width="600px" Height="600px"
                        Skin="WebBlue" Behaviors="Close" Modal="true" OnClientClose="MarketsChange">
                        <Windows>
                            <telerik:RadWindow ID="radWindowMarket" runat="server" Width="600px" Height="600px"
                                OnClientClose="MarketsChange">
                            </telerik:RadWindow>
                        </Windows>
                    </telerik:RadWindowManager>
                    <asp:HiddenField ID="hdnEmbranchMentCount" runat="server" />
                </div>
            </td>
            <!--#right end-->
        </tr>
    </table>
</asp:Content>
